package com.engine.cetc.service.impl;

import com.engine.cetc.service.SmartInputService;
import com.engine.core.impl.Service;
import weaver.conn.RecordSet;
import weaver.general.Util;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

/**
 * @Title: ecology-idea
 * @Company: 泛微软件
 * @author: weaver.Dusongsong
 * @version: 1.0
 * @CreateDate: 2022-03-22
 * @Description: ${description}
 * @ModifyLog:
 **/

public class SmartInputServiceImpl extends Service implements SmartInputService {
    public SmartInputServiceImpl() {
    }
    @Override
    public Map<String, Object> getDetailInfo(Map<String, Object> params) {
        HashMap map = new HashMap();
        ArrayList arrayList = new ArrayList();
        String name = Util.null2String(params.get("name"));
        RecordSet rs = new RecordSet();
        rs.executeQuery(" select id,skrmcskdwmc,khyx,zh from uf_skrskdw where skrmcskdwmc like '%"+name+"%'");
        while(rs.next()) {
            HashMap datamap = new HashMap();
            String id = Util.null2String(rs.getString( "id" ));
            String skrmcskdwmc = Util.null2String(rs.getString( "skrmcskdwmc" ));
            String khyx = Util.null2String(rs.getString( "khyx" ));
            String zh = Util.null2String(rs.getString( "zh" ));
            datamap.put("uid", id);
            datamap.put("skmc", skrmcskdwmc);
            datamap.put("khyx", khyx);
            datamap.put("zh", zh);
            arrayList.add(datamap);
        }
        map.put("data", arrayList);
        return map;
    }
}
